package com.time.sky.mapper;

import com.time.sky.entity.RM;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface RMMapper {
    @Select("SELECT * FROM RM r LEFT JOIN UINFO u ON r.uid=u.uid LEFT JOIN BINFO b ON u.bid=b.bid")
    List<RM> selectList();
    @Insert("insert into RM(oname,status,bid) " +
            "values(#{oname},#{status},#{bid})")
    void add(RM rm);
    @Delete("delete from RM where rid=#{rid}")
    void delete(int rid);
    @Select("SELECT * FROM RM  where oid=#{oid}")
    RM getById(int rid);
    @Update("update RM set  where rid=#{rid}")
    void update(RM rm);
    @Select("select count(*) from RM")
    int getRowCount();
}
